package(default_visibility = ["//:__subpackages__"])

licenses(["notice"])

cc_library(
    name = "ecdsa_raw_sign_boringssl",
    srcs = ["ecdsa_raw_sign_boringssl.cc"],
    hdrs = ["ecdsa_raw_sign_boringssl.h"],
    include_prefix = "tink/signature/internal",
    deps = [
        "//:public_key_sign",
        "//internal:bn_util",
        "//internal:ec_util",
        "//internal:err_util",
        "//internal:fips_utils",
        "//internal:md_util",
        "//internal:ssl_unique_ptr",
        "//internal:util",
        "//subtle:common_enums",
        "//subtle:subtle_util_boringssl",
        "//util:errors",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "config_v0",
    srcs = ["config_v0.cc"],
    hdrs = ["config_v0.h"],
    include_prefix = "tink/signature/internal",
    deps = [
        "//:configuration",
        "//internal:configuration_impl",
        "//signature:ecdsa_sign_key_manager",
        "//signature:ecdsa_verify_key_manager",
        "//signature:ed25519_sign_key_manager",
        "//signature:ed25519_verify_key_manager",
        "//signature:public_key_sign_wrapper",
        "//signature:public_key_verify_wrapper",
        "//signature:rsa_ssa_pkcs1_sign_key_manager",
        "//signature:rsa_ssa_pkcs1_verify_key_manager",
        "//signature:rsa_ssa_pss_sign_key_manager",
        "//signature:rsa_ssa_pss_verify_key_manager",
        "//util:status",
        "@com_google_absl//absl/memory",
    ],
)

cc_library(
    name = "key_gen_config_v0",
    srcs = ["key_gen_config_v0.cc"],
    hdrs = ["key_gen_config_v0.h"],
    include_prefix = "tink/signature/internal",
    deps = [
        "//:key_gen_configuration",
        "//internal:key_gen_configuration_impl",
        "//signature:ecdsa_sign_key_manager",
        "//signature:ecdsa_verify_key_manager",
        "//signature:ed25519_sign_key_manager",
        "//signature:ed25519_verify_key_manager",
        "//signature:rsa_ssa_pkcs1_sign_key_manager",
        "//signature:rsa_ssa_pkcs1_verify_key_manager",
        "//signature:rsa_ssa_pss_sign_key_manager",
        "//signature:rsa_ssa_pss_verify_key_manager",
        "//util:status",
        "@com_google_absl//absl/memory",
    ],
)

cc_library(
    name = "config_fips_140_2",
    srcs = ["config_fips_140_2.cc"],
    hdrs = ["config_fips_140_2.h"],
    include_prefix = "tink/signature/internal",
    deps = [
        "//:configuration",
        "//internal:configuration_impl",
        "//internal:fips_utils",
        "//signature:ecdsa_sign_key_manager",
        "//signature:ecdsa_verify_key_manager",
        "//signature:public_key_sign_wrapper",
        "//signature:public_key_verify_wrapper",
        "//signature:rsa_ssa_pkcs1_sign_key_manager",
        "//signature:rsa_ssa_pkcs1_verify_key_manager",
        "//signature:rsa_ssa_pss_sign_key_manager",
        "//signature:rsa_ssa_pss_verify_key_manager",
        "//util:status",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
    ],
)

# tests

cc_test(
    name = "ecdsa_raw_sign_boringssl_test",
    size = "small",
    srcs = ["ecdsa_raw_sign_boringssl_test.cc"],
    tags = ["fips"],
    deps = [
        ":ecdsa_raw_sign_boringssl",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:ec_util",
        "//internal:fips_utils",
        "//internal:md_util",
        "//subtle:common_enums",
        "//subtle:ecdsa_verify_boringssl",
        "//subtle:subtle_util_boringssl",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "config_v0_test",
    srcs = ["config_v0_test.cc"],
    deps = [
        ":config_v0",
        ":key_gen_config_v0",
        "//:configuration",
        "//:key_gen_configuration",
        "//:keyset_handle",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:configuration_impl",
        "//internal:key_gen_configuration_impl",
        "//internal:key_type_info_store",
        "//internal:keyset_wrapper_store",
        "//proto:tink_cc_proto",
        "//signature:ecdsa_verify_key_manager",
        "//signature:ed25519_verify_key_manager",
        "//signature:rsa_ssa_pkcs1_verify_key_manager",
        "//signature:rsa_ssa_pss_verify_key_manager",
        "//signature:signature_key_templates",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "config_fips_140_2_test",
    srcs = ["config_fips_140_2_test.cc"],
    deps = [
        ":config_fips_140_2",
        ":key_gen_config_v0",
        "//:configuration",
        "//:key_gen_configuration",
        "//:keyset_handle",
        "//:public_key_sign",
        "//:public_key_verify",
        "//internal:configuration_impl",
        "//internal:fips_utils",
        "//internal:key_type_info_store",
        "//internal:keyset_wrapper_store",
        "//proto:tink_cc_proto",
        "//signature:ecdsa_verify_key_manager",
        "//signature:ed25519_verify_key_manager",
        "//signature:rsa_ssa_pkcs1_verify_key_manager",
        "//signature:rsa_ssa_pss_verify_key_manager",
        "//signature:signature_key_templates",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)
